<template>
    <div class="bottomStyle">
        展示孙子组件信息
        <div>父组件向后代组件传递金额：{{ money }}</div>
        <button @click="updateMoney(1)">花费金额</button>
    </div>
</template>

<script setup lang="ts">
import {inject} from 'vue'
// 接受传递的数据,可以赋值默认值
let {money,updateMoney} = inject('moneyContent',{money:0,updateMoney:(x:number)=>{}})

</script>

<style scoped>
    .bottomStyle{
        background-color: #c12727;
        padding: 20px;
        border-radius: 10px;
        color: #ffffff;
    }
</style>